load("@rules_java//java:defs.bzl", "java_binary")
load("@rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library")
load("@rules_kotlin//kotlin:lint.bzl", "ktlint_fix", "ktlint_test")

kt_jvm_library(
    name = "app_lib",
    srcs = glob(["**/*.kt"]),
    deps = [
        "//:java_deps",
    ],
)

ktlint_test(
    name = "lint_test",
    srcs = glob(["**/*.kt"]),
    config = "//:ktlint_editorconfig",
)

ktlint_fix(
    name = "lint_fix",
    srcs = glob(["**/*.kt"]),
    config = "//:ktlint_editorconfig",
)

java_binary(
    name = "myapp",
    main_class = "app.MyApp",
    visibility = [
        "//visibility:public",
    ],
    runtime_deps = [":app_lib"],
)
